//
//  P1308.cpp
//  Algorithm
//
//  Created by 刘锦程 on 2023/9/21.
//

#include <stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
string pat;
char soru[2000000];
void tolow(string &s){
    int i=0;
    while(s[i]!=0){
        if(s[i]>='A'&&s[i]<='Z') s[i]+=32;
        i++;
    }
}
int P1308ans(){
    cin>>pat;
    tolow(pat);
    int i=0,ans=0,wordlen=0,wordbegin=0,flag=-1,patlen=pat.length();
    getchar();
    while((soru[i]=getchar())!=EOF){
        if(soru[i]=='\n')break;
        if(soru[i]==' '){
            if(patlen==wordlen){
                string words;
                for(int z=0;z<wordlen;z++){
                words=words+soru[wordbegin+z];
                }
                tolow(words);
                if(pat==words){
                    if(flag==-1) flag=wordbegin;
                    ans++;
                }
            }
            wordlen=0;
            wordbegin=i+1;
        }else wordlen++;
        i++;
    }
    if(flag==-1){
        cout<<flag<<endl;
    }else{
        cout<<ans<<" "<<flag;
    }
    return 0;
}
